<template>
    <el-card class="page-container">
        <template #header>
            <div class="header">
                <span>{{ title }}</span>
                <div class="extra">
                    <!-- 具名插槽，header 右边按钮区域 -->
                    <slot name="header-right"></slot>
                </div>
            </div>
        </template>
        <!-- 默认插槽 -->
        <slot></slot>
    </el-card>
</template>
<script setup>
defineProps({
    title: {
        required: true,
        type: String,
    }
})
</script>
<style scoped>
.page-container {
    min-height: 100%;
    box-sizing: border-box;
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}
</style>